import request from '@/utils/request'

export function appealList(query) {
  return request({
    url: '/appeals',
    method: 'get',
    params: query
  })
}

export function appealAdd(data) {
  return request({
    url: '/appeal',
    method: 'post',
    data
  })
}

export function appealDelete(id) {
  return request({
    url: `/appeal/${id}`,
    method: 'delete'
  })
}

export function appealUpdate(id, data) {
  return request({
    url: `/appeal/${id}`,
    method: 'put',
    data
  })
}

export function appealSubmit(id, data) {
  return request({
    url: `/appeal/${id}/submit`,
    method: 'put',
    data
  })
}

export function appealDrawback(id, data) {
  return request({
    url: `/appeal/${id}/drawback`,
    method: 'put',
    data
  })
}

export function appealDetailList(explainId) {
  return request({
    url: `/appeal/${explainId}/details`,
    method: 'get',
    params: explainId
  })
}
